/*
 * mhpropertycontainer.cpp
 *
 *  Created on: 2010-7-15
 *      Author: angelstone
 */
#include <wx/wx.h>
#include "mhpropertycontainer.h"

using namespace mediahouse;

void CMHPropertyContainer::SetProperty(const wxString & name,
		const wxString & value) {
	m_Properties[name] = value;
}
void CMHPropertyContainer::RemoveProperty(const wxString & name) {
	m_Properties.erase(name);
}
int CMHPropertyContainer::HasProperty(const wxString & name) {
	return m_Properties.find(name) != m_Properties.end();
}
int CMHPropertyContainer::GetProperty(const wxString & name, wxString & value) {
	wxHashmapStr2StrNoCase::iterator it = m_Properties.find(name);

	if (it != m_Properties.end()) {
		value = it->second;
		return 0;
	}
	return 1;
}
void CMHPropertyContainer::ClearProperties() {
	m_Properties.clear();
}
int CMHPropertyContainer::GetAllProperties(wxHashmapStr2StrNoCase & properties) {
	wxHashmapStr2StrNoCase::iterator it;

	for (it = m_Properties.begin(); it != m_Properties.end(); it++) {
		properties.insert(*it);
	}
	return 0;
}

